<?php

namespace app\api\model;

use think\Model;


class ShopYiwu extends Model
{

    // 表名
    protected $table = 'tp_shop_yiwu';
    
    // 自动写入时间戳字段
    protected $autoWriteTimestamp = false;

    // 定义时间戳字段名
    protected $createTime = false;
    protected $updateTime = false;
    protected $deleteTime = false;

    // 追加属性
    protected $append = [

    ];

    public function getThumbPicAttr($value, $data){
        $value = $value ? $value : ($data['thumb_pic'] ?? "");
        if(!empty($value)){
            return str_replace('/public','',$value);
        }
    }
}
